$(function(){
	$("#search").bind('input propertychange',function(){
		$("#show").empty();
		getAreas($("#search").val());
	})

	function getAreas(likeName){
		$.ajax({
			type:"GET",
			url:"http://localhost:8080/baidu/area/all?likeName="+likeName
		})
		.done(function(msg){
			console.log(msg);
			showArea(msg);
		});
	}
	function showArea(data){
		data.forEach(function(item){
			$("#show").append("<p>"+item.name+"</p>");
		});
	}
})

